#include <iostream>
#include <fstream>
#include "suffixTree.hpp"

using namespace std;

int main (int argc, char **argv)
{
    if (argc < 2) {
	cout<<"Usage: ./testSuffixTree <name of the file to serialize>"<<endl;
	return -1;
    }
    ofstream outFile;
    outFile.open(argv[2]);
    suffixTree sTree;
    string word;
    char ans;
    do {
	cout<<"word to insert: ";
	cin>>word;
	sTree.insert(word);
	cout<<"continue? ";
	cin>>ans;
    } while (ans != 'n' && ans != 'N');
    sTree.serialize(outFile);
    cout<<"done!"<<endl;
    outFile.close();

    return 0;
}
